package com.mycompany.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.mycompany.entity.Rule;
import com.mycompany.repository.RuleDao;
import com.mycompany.service.RuleService;

@Service
public class RuleServiceImpl implements RuleService {
	
	@Autowired
	private RuleDao ruleDao;

	@Override
	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public void persist(Rule rule) {
		ruleDao.persist(rule);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public void merge(Rule rule) {
		ruleDao.merge(rule);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public void remove(Rule rule) {
		ruleDao.remove(rule);
	}

	@Override
	public Rule findById(Integer ruleId) {
		return ruleDao.findById(ruleId);
	}

	@Override
	public Rule find(Rule rule) {
		return ruleDao.find(rule);
	}

	@Override
	public List<Rule> findAll() {
		return ruleDao.findAll();
	}

	@Override
	public List<Rule> findListByCodition(Rule rule) {
		return ruleDao.findListByCodition(rule);
	}

}
